package org.thanos.demo.service.user;

import org.apache.shiro.lang.util.Assert;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;
import org.thanos.demo.entity.SysUser;

@Service("sysUserService")
public class SysUserServiceImpl implements SysUserService {

    @Override
    public SysUser selectByLoginId(String loginId) {
        Assert.isTrue(!StringUtils.isEmpty(loginId));
        return SysUser.data().stream().filter(sysUser -> sysUser.getLoginId().equals(loginId)).findAny().orElse(null);
    }
}
